<?php

/**
 * Feedback form base class.
 *
 * @method Feedback getObject() Returns the current form's model object
 *
 * @package    KrazyTaxi
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseFeedbackForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IDFEEDBACK'           => new sfWidgetFormInputHidden(),
      'IDUSUARIO'            => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUserProfile', 'add_empty' => false)),
      'PATENTETAXI'          => new sfWidgetFormPropelChoice(array('model' => 'Taxi', 'add_empty' => false)),
      'FECHAFEEDBACK'        => new sfWidgetFormDateTime(),
      'CALIFICACIONFEEDBACK' => new sfWidgetFormInputText(),
      'COMENTARIOFEEDBACK'   => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'IDFEEDBACK'           => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdfeedback()), 'empty_value' => $this->getObject()->getIdfeedback(), 'required' => false)),
      'IDUSUARIO'            => new sfValidatorPropelChoice(array('model' => 'sfGuardUserProfile', 'column' => 'IDUSUARIO')),
      'PATENTETAXI'          => new sfValidatorPropelChoice(array('model' => 'Taxi', 'column' => 'PATENTETAXI')),
      'FECHAFEEDBACK'        => new sfValidatorDateTime(),
      'CALIFICACIONFEEDBACK' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'COMENTARIOFEEDBACK'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('feedback[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Feedback';
  }


}
